<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="TagDataSet" targetNamespace="http://tempuri.org/TagDataSet.xsd" xmlns:mstns="http://tempuri.org/TagDataSet.xsd" xmlns="http://tempuri.org/TagDataSet.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="SocialNetworkConnectionString" ConnectionStringObject="" IsAppSettingsProperty="True" Modifier="Assembly" Name="SocialNetworkConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.WLQuickApps.SocialNetwork.Data.Properties.Settings.GlobalReference.Default.SocialNetworkConnectionString" Provider="System.Data.SqlClient">
          </Connection>
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="TagTableAdapter" GeneratorDataComponentClassName="TagTableAdapter" Name="Tag" UserDataComponentName="TagTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="SocialNetwork.dbo.Tag" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="True" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="True" UserGetMethodName="GetData" UserSourceName="Fill">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="False">
                    <CommandText>DELETE FROM [Tag] WHERE (([TagID] = @Original_TagID) AND ([Name] = @Original_Name))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_TagID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TagID" SourceColumnNullMapping="False" SourceVersion="Original">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Name" SourceColumnNullMapping="False" SourceVersion="Original">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="False">
                    <CommandText>INSERT INTO [Tag] ([Name]) VALUES (@Name);
SELECT TagID, Name FROM Tag WHERE (TagID = SCOPE_IDENTITY())</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Name" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>SELECT TagID, Name FROM Tag</CommandText>
                    <Parameters>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="False">
                    <CommandText>UPDATE [Tag] SET [Name] = @Name WHERE (([TagID] = @Original_TagID) AND ([Name] = @Original_Name));
SELECT TagID, Name FROM Tag WHERE (TagID = @TagID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Name" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_TagID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TagID" SourceColumnNullMapping="False" SourceVersion="Original">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Name" SourceColumnNullMapping="False" SourceVersion="Original">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="TagID" ColumnName="TagID" DataSourceName="SocialNetwork.dbo.Tag" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@TagID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="TagID" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="TagID" DataSetColumn="TagID" />
              <Mapping SourceColumn="Name" DataSetColumn="Name" />
            </Mappings>
            <Sources>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="True" GeneratorSourceName="AddTagToBaseItemID" Modifier="Public" Name="AddTagToBaseItemID" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="True" UserGetMethodName="GetDataBy" UserSourceName="AddTagToBaseItemID">
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>DELETE FROM BaseItemTag
WHERE TagID = @tagID
AND BaseItemID = @baseItemID;

INSERT INTO BaseItemTag
                         (TagID, BaseItemID)
VALUES        (@tagID,@baseItemID);</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="tagID" ColumnName="TagID" DataSourceName="SocialNetwork.dbo.BaseItemTag" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@tagID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="TagID" SourceColumnNullMapping="False" SourceVersion="Original">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="SocialNetwork.dbo.BaseItemTag" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="False" SourceVersion="Original">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="True" GeneratorSourceName="CreateTag" Modifier="Public" Name="CreateTag" QueryType="Scalar" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="True" UserGetMethodName="GetDataBy1" UserSourceName="CreateTag">
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>INSERT INTO [dbo].[Tag] ([Name]) VALUES (@name);
SELECT SCOPE_IDENTITY()</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="name" ColumnName="Name" DataSourceName="SocialNetwork.dbo.Tag" DataTypeServer="varchar(32)" DbType="AnsiString" Direction="Input" ParameterName="@name" Precision="0" ProviderType="VarChar" Scale="0" Size="32" SourceColumn="Name" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="SocialNetwork.dbo.Tag" DbObjectType="Table" GenerateMethods="Get" GenerateShortCommands="True" GeneratorGetMethodName="GetTagByName" GetMethodModifier="Public" GetMethodName="GetTagByName" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="True" UserGetMethodName="GetTagByName" UserSourceName="GetTagByName1">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>SELECT Name, TagID FROM Tag WHERE (Name = @name)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="name" ColumnName="Name" DataSourceName="SocialNetwork.dbo.Tag" DataTypeServer="varchar(32)" DbType="AnsiString" Direction="Input" ParameterName="@name" Precision="0" ProviderType="VarChar" Scale="0" Size="32" SourceColumn="Name" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="SocialNetwork.dbo.Tag" DbObjectType="Table" GenerateMethods="Get" GenerateShortCommands="True" GeneratorGetMethodName="GetTagByTagID" GetMethodModifier="Public" GetMethodName="GetTagByTagID" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="True" UserGetMethodName="GetTagByTagID" UserSourceName="GetTagByTagID1">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>SELECT Name, TagID FROM Tag WHERE (TagID = @tagID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="tagID" ColumnName="TagID" DataSourceName="SocialNetwork.dbo.Tag" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@tagID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="TagID" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="SocialNetwork.dbo.Tag" DbObjectType="Table" GenerateMethods="Get" GenerateShortCommands="True" GeneratorGetMethodName="GetTagsByBaseItemID" GetMethodModifier="Public" GetMethodName="GetTagsByBaseItemID" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="True" UserGetMethodName="GetTagsByBaseItemID" UserSourceName="GetTagsByBaseItemID1">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>SELECT Tag.Name, Tag.TagID FROM Tag INNER JOIN 
BaseItemTag ON Tag.TagID = BaseItemTag.TagID 
INNER JOIN BaseItem ON BaseItemTag.BaseItemID = BaseItem.BaseItemID 
WHERE (BaseItem.BaseItemID = @baseItemID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="True" GeneratorSourceName="RemoveTagFromBaseItemID" Modifier="Public" Name="RemoveTagFromBaseItemID" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="True" UserGetMethodName="GetDataBy2" UserSourceName="RemoveTagFromBaseItemID">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>DELETE FROM BaseItemTag
WHERE TagID = @tagID
AND BaseItemID = @baseItemID</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="tagID" ColumnName="TagID" DataSourceName="SocialNetwork.dbo.BaseItemTag" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@tagID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="TagID" SourceColumnNullMapping="False" SourceVersion="Original">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="SocialNetwork.dbo.BaseItemTag" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="False" SourceVersion="Original">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
              </DbSource>
            </Sources>
          </TableAdapter>
        </Tables>
        <Sources>
        </Sources>
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="TagDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="TagDataSet" msprop:Generator_DataSetName="TagDataSet">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Tag" msprop:Generator_UserTableName="Tag" msprop:Generator_RowDeletedName="TagRowDeleted" msprop:Generator_RowChangedName="TagRowChanged" msprop:Generator_RowClassName="TagRow" msprop:Generator_RowChangingName="TagRowChanging" msprop:Generator_RowEvArgName="TagRowChangeEvent" msprop:Generator_RowEvHandlerName="TagRowChangeEventHandler" msprop:Generator_TableClassName="TagDataTable" msprop:Generator_TableVarName="tableTag" msprop:Generator_RowDeletingName="TagRowDeleting" msprop:Generator_TablePropName="Tag">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="TagID" msdata:ReadOnly="true" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="TagID" msprop:Generator_ColumnVarNameInTable="columnTagID" msprop:Generator_ColumnPropNameInRow="TagID" msprop:Generator_ColumnPropNameInTable="TagIDColumn" type="xs:int" />
              <xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnPropNameInTable="NameColumn">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="32" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:Tag" />
      <xs:field xpath="mstns:TagID" />
    </xs:unique>
    <xs:unique name="Constraint2">
      <xs:selector xpath=".//mstns:Tag" />
      <xs:field xpath="mstns:Name" />
    </xs:unique>
  </xs:element>
</xs:schema>